package be.kuleuven.mume.framework;

import java.util.HashMap;
import java.util.Map;

import be.kuleuven.mume.framework.AgendaItem.TypeItem;
import android.graphics.Color;
import android.util.Log;
import android.view.View;

public class Mobilenvi {
	//private static final String BASEURL1 = "http://192.168.123.102:8888";
	private static final String BASEURL2= "https://mobilenvi.appspot.com";
	public String BASEURL;
	private static Mobilenvi mobilenvi;
	public static int tabHeight = 50;
	public Map<TypeItem,String> agendaColors = new HashMap<AgendaItem.TypeItem, String>();
	
	public static final boolean debug = true;
	
	private Mobilenvi(){
		BASEURL = BASEURL2;
		agendaColors.put(TypeItem.Deathline, "#CC9933");
		agendaColors.put(TypeItem.VrijeTijd, "#0099CC");
		agendaColors.put(TypeItem.Afspraken, "#009933");
		agendaColors.put(TypeItem.Uurooster, "#BBBBBB");
	}
	
	public static Mobilenvi getSingelton(){
		if(Mobilenvi.mobilenvi == null){
			Mobilenvi.mobilenvi = new  Mobilenvi();
			Log.d("Mobilenvi", "Singelton created");
		}
		
		return Mobilenvi.mobilenvi;
	}
	
	public void setBaseUrl(String url){
		BASEURL = url;
	}
	
	public void setBackgroundColor(View view, TypeItem type) {
		if(agendaColors.containsKey(type)){
			String color = agendaColors.get(type);
			view.setBackgroundColor(Color.parseColor(color));
		}else
			view.setBackgroundColor(Color.BLACK);
	}
}
